package com.example.common;

import lombok.Getter;

@Getter
public enum ResultCode {
    SUCCESS(200, "操作成功"),
    ERROR(500, "操作失败"),
    VALIDATE_FAILED(404, "参数检验失败"),
    UNAUTHORIZED(401, "暂未登录或token已经过期"),
    FORBIDDEN(403, "没有相关权限"),
    
    // 业务异常
    VOLUNTEER_NOT_FOUND(1001, "志愿者不存在"),
    VOLUNTEER_ALREADY_EXISTS(1002, "志愿者已存在"),
    ID_CARD_ALREADY_EXISTS(1003, "身份证号已存在"),
    PHONE_ALREADY_EXISTS(1004, "手机号已存在"),
    
    // 活动相关异常
    ACTIVITY_NOT_FOUND(2001, "活动不存在"),
    ACTIVITY_TIME_INVALID(2002, "活动时间无效"),
    ACTIVITY_STATUS_INVALID(2003, "活动状态无效"),
    ACTIVITY_CANNOT_MODIFY(2004, "活动当前状态不允许修改"),
    ACTIVITY_CANNOT_DELETE(2005, "活动当前状态不允许删除");

    private final Integer code;
    private final String message;

    ResultCode(Integer code, String message) {
        this.code = code;
        this.message = message;
    }
} 